{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "17f3b156",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.makedirs('data', exist_ok=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3e2bf155",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_file=os.path.join('data','house_tiny.csv')\n",
    "with open(data_file,'w')as f:\n",
    "        f.write('Name,age,gender\\n')\n",
    "        f.write('jack,20,man\\n')\n",
    "        f.write('mike,23,woman\\n')\n",
    "        f.write('lucy,34,man\\n')\n",
    "        f.write('ben,46,woman\\n')\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3ecb60bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   Name  age gender\n",
      "0  jack   20    man\n",
      "1  mike   23  woman\n",
      "2  lucy   34    man\n",
      "3   ben   46  woman\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data=pd.read_csv(data_file)\n",
    "print(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "356c3229",
   "metadata": {},
   "outputs": [],
   "source": [
    "inputs=data.iloc[:,0:2]  #选取的前三列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eb53ca51",
   "metadata": {},
   "outputs": [],
   "source": [
    "outputs=data.iloc[:,2]   #选取的是第三类\n",
    "inputs=inputs.filelna(inputs.mean())  #用\n",
    "print(inputs)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:yzk] *",
   "language": "python",
   "name": "conda-env-yzk-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.20"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
